-
Notifications
You must be signed in to change notification settings - Fork 45
Tests/services for Common-API #272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: release-3.4.0
Are you sure you want to change the base?
Conversation
* fix: fixed the user session not found db issue * fix: fixed the redis config * fix: added the transit
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
Release 3.2.1 to main Branch merge
* Fix the issue in fetching the value for fields (PSMRI#257) * fix: Add jsonProperty to map with the request body to fix the issue in getting the value for income, education and occupation * fix: remove commented code * Update version in pom.xml to 3.4.0 * Update pom.xml * Add ServerAuthorization key in allow headers (PSMRI#275) * fix: add serverAuthorization * fix: add console * fix: correct the spelling * Nd/vs/token bengen issue (PSMRI#280) * fix: add useragent as java to skip the token * fix: add logger * fix: add logger --------- Co-authored-by: Vanitha S <116701245+vanitha1822@users.noreply.github.com> Co-authored-by: Amoghavarsh <93114621+5Amogh@users.noreply.github.com> Co-authored-by: Mithun James <drtechie@users.noreply.github.com>
if (everwellBenRegListAS != null) { | ||
|
||
registerEverWellPatient(everwellBenRegListAS, Authorization); | ||
registerEverWellPatient(everwellBenRegListAS, Authorization, new RestTemplate()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is RestTemplate being passed here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because , since the rest template is being created and used in the function its not testable ... so passing a rest template allows the code to be tested
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
another approach could also be that , the rest template could be defined at class level, but I wasnt sure that would be appropriate to do
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Zapper9982 Is it really necessary to add this extra parameter to the function? Have you tested whether it will not affect the flow of the application?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vanitha1822 , yes as u can see I have changed all the calls to registereverwellPatient to have the rest template .
src/test/java/com/iemr/common/controller/carestream/CareStreamCreateOrderControllerTest.java
Outdated
Show resolved
Hide resolved
…/CareStreamCreateOrderControllerTest.java
|
📋 Description
This pull request introduces a significant number of new unit tests and fixes for existing tests across more than 80 files. The primary motivation is to enhance the overall test coverage of the
Common-API
service layer, improve code quality, and ensure the reliability of existing and new functionality. The changes address various failing tests and add comprehensive test cases for previously untested code paths.NOTE :
Some of the extremely huge services which are Admin and CTI do not have a testcase cause of hallucinations will be looked into it with a later PR .
Some of the services have a
RestTemplate
instantiated within the method and not as a class declaration causing the methods to be rendered non - testable@vanitha1822
✅ Type of Change
ℹ️ Additional Information
The changes were tested by running the full suite of unit tests locally. The focus has been on:
NullPointerException
, incorrect mocking, or assertion errors.The work spans over 80 files, indicating a widespread effort to improve the test harness of the application.
Screenshots
@drtechie @vanitha1822 Raising a PR , a total of 1705 Testcases are currently written.
Some of the failures are because of :